package mts.constants;

public enum Direction {
	UP((byte)0) {
		@Override
		public String toString() {
			return "UP";
		}
	},
	DOWN((byte)1) {
		@Override
		public String toString() {
			return "DN";
		}
	};
	
	private byte val;
	
	public byte getByteValue() {
		return val;
	}
	
	private Direction(byte val) {
		this.val = val;
	}
	
	public static Direction valueOf(byte val) {
		for (Direction dir: Direction.values()) {
			if (dir.val == val) {
				return dir;
			}
		}
		
		throw new RuntimeException("Invalid Direction - " + val);
	}
}
